package com.frame.domain;

import java.io.Serializable;
import java.util.Date;

import com.mini.core.WeakEntity;
import com.mini.core.annotation.Column;
import com.mini.core.annotation.Entity;
import com.mini.core.utils.EnumClazz.StrategyType;

/**
 * @author sxjun
 * @version 2016-3-11
 */
@Entity(table="DEPARTMENT",id="ID",strategy=StrategyType.UUID)
public class Department extends WeakEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	
    /**
	 * Columns
	 */
	public static final class Columns {
		public static final String id = "ID";
		public static final String parentid = "PARENTID";
		public static final String name = "NAME";
		public static final String sort = "SORT";
		public static final String createtime = "CREATETIME";
	}

	/**
	 * Primary key
	 * @return
	 */
	@Column("id")
    public String getId() {
    	return super.getStr(Columns.id);
	}

    /**
	 * Primary key
	 * @param id
	 * @return
	 */
	public Department setId(String id) {
		super.set(Columns.id, id);
		return this;
	}

	/**
	 * Get the createtime
	 * @return
	 */
	@Column("createtime")
	public Date getCreatetime() {
		return super.getDate(Columns.createtime);
	}

	/**
	 * set the createtime
	 * @param createtime
	 * @return
	 */
	public Department setCreatetime(Date createtime) {
		super.set(Columns.createtime, createtime);
		return this;
	}

	/**
	 * Get the parentid of the department
	 * @return
	 */
	@Column("parentid")
	public String getParentid() {
		return super.getStr(Columns.parentid);
	}

	/**
	 * Set the parentid of the department
	 * @param parentid
	 * @return
	 */
	public Department setParentid(String parentid) {
		super.set(Columns.parentid, parentid);
		return this;
	}

	/**
	 * Get the name of department
	 * @return
	 */
	@Column("name")
	public String getName() {
		return super.getStr(Columns.name);
	}

	/**
	 * Set the name of department
	 * @param name
	 * @return
	 */
	public Department setName(String name) {
		super.set(Columns.name,name);
		return this;
	}
	
	/**
	 * Get the sort of department
	 * @return
	 */
	@Column("sort")
	public int getSort() {
		return super.getInt(Columns.sort);
	}

	/**
	 * Set the sort of department
	 * @param sort
	 * @return
	 */
	public Department setSort(String sort) {
		super.set(Columns.sort,sort);
		return this;
	}
}
